(* ::Package:: *)

(************************************************************************)
(* This file was generated automatically by the Mathematica front end.  *)
(* It contains Initialization cells from a Notebook file, which         *)
(* typically will have the same name as this file except ending in      *)
(* ".nb" instead of ".m".                                               *)
(*                                                                      *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs.  Doing so is equivalent   *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end.                                                                 *)
(*                                                                      *)
(* DO NOT EDIT THIS FILE.  This entire file is regenerated              *)
(* automatically each time the parent Notebook file is saved in the     *)
(* Mathematica front end.  Any changes you make to this file will be    *)
(* overwritten.                                                         *)
(************************************************************************)



(* ::Code:: *)
Int[ArcCos[a_.+b_.*x_],x_Symbol] :=
  (a+b*x)*ArcCos[a+b*x]/b - Sqrt[1-(a+b*x)^2]/b /;
FreeQ[{a,b},x]


(* ::Code:: *)
Int[ArcCos[a_.+b_.*x_]^n_,x_Symbol] :=
  (a+b*x)*ArcCos[a+b*x]^n/b -
  n*Sqrt[1-(a+b*x)^2]*ArcCos[a+b*x]^(n-1)/b -
  Dist[n*(n-1),Int[ArcCos[a+b*x]^(n-2),x]] /;
FreeQ[{a,b},x] && RationalQ[n] && n>1


(* ::Code:: *)
Int[1/ArcCos[a_.+b_.*x_],x_Symbol] :=
  -SinIntegral[ArcCos[a+b*x]]/b /;
FreeQ[{a,b},x]


(* ::Code:: *)
Int[1/ArcCos[a_.+b_.*x_]^2,x_Symbol] :=
  Sqrt[1-(a+b*x)^2]/(b*ArcCos[a+b*x]) - CosIntegral[ArcCos[a+b*x]]/b /;
FreeQ[{a,b},x]


(* ::Code:: *)
Int[1/Sqrt[ArcCos[a_.+b_.*x_]],x_Symbol] :=
  -Sqrt[2*Pi]*FresnelS[Sqrt[2/Pi]*Sqrt[ArcCos[a+b*x]]]/b /;
FreeQ[{a,b},x]


(* ::Code:: *)
Int[Sqrt[ArcCos[a_.+b_.*x_]],x_Symbol] :=
  (a+b*x)*Sqrt[ArcCos[a+b*x]]/b - Sqrt[Pi/2]*FresnelC[Sqrt[2/Pi]*Sqrt[ArcCos[a+b*x]]]/b /;
FreeQ[{a,b},x]


(* ::Code:: *)
Int[ArcCos[a_.+b_.*x_]^n_,x_Symbol] :=
  (a+b*x)*ArcCos[a+b*x]^(n+2)/(b*(n+1)*(n+2)) -
  Sqrt[1-(a+b*x)^2]*ArcCos[a+b*x]^(n+1)/(b*(n+1)) -
  Dist[1/((n+1)*(n+2)),Int[ArcCos[a+b*x]^(n+2),x]] /;
FreeQ[{a,b},x] && RationalQ[n] && n<-1 && n!=-2


(* ::Code:: *)
Int[ArcCos[a_.+b_.*x_]^n_,x_Symbol] :=
  ArcCos[a+b*x]^n/(2*b)*
    (Gamma[n+1,I*ArcCos[a+b*x]]/(I*ArcCos[a+b*x])^n + 
     Gamma[n+1,-I*ArcCos[a+b*x]]/(-I*ArcCos[a+b*x])^n) /;
FreeQ[{a,b,n},x] && (Not[RationalQ[n]] || -1<n<1)


(* ::Code:: *)
Int[x_^m_.*ArcCos[a_.+b_.*x_],x_Symbol] :=
  x^(m+1)*ArcCos[a+b*x]/(m+1) +
  Dist[b/(m+1),Int[x^(m+1)/Sqrt[1-a^2-2*a*b*x-b^2*x^2],x]] /;
FreeQ[{a,b,m},x] && NonzeroQ[m+1]


(* ::Code:: *)
Int[x_/Sqrt[ArcCos[a_.*x_]],x_Symbol] :=
  -Sqrt[Pi]/(2*a^2)*FresnelS[2*Sqrt[ArcCos[a*x]]/Sqrt[Pi]] /;
FreeQ[a,x]


(* ::Code:: *)
Int[x_/ArcCos[a_.*x_]^(3/2),x_Symbol] :=
  2*x*Sqrt[1-a^2*x^2]/(a*Sqrt[ArcCos[a*x]]) - 2*Sqrt[Pi]/a^2*FresnelC[2*Sqrt[ArcCos[a*x]]/Sqrt[Pi]] /;
FreeQ[a,x]


(* ::Code:: *)
Int[x_*ArcCos[a_.*x_]^n_,x_Symbol] :=
  -n*x*Sqrt[1-a^2*x^2]*ArcCos[a*x]^(n-1)/(4*a) -
  ArcCos[a*x]^n/(4*a^2) + x^2*ArcCos[a*x]^n/2 -
  Dist[n*(n-1)/4,Int[x*ArcCos[a*x]^(n-2),x]] /;
FreeQ[a,x] && RationalQ[n] && n>0


(* ::Code:: *)
Int[x_*ArcCos[a_.*x_]^n_,x_Symbol] :=
  -x*Sqrt[1-a^2*x^2]*ArcCos[a*x]^(n+1)/(a*(n+1)) -
  ArcCos[a*x]^(n+2)/(a^2*(n+1)*(n+2)) +
  2*x^2*ArcCos[a*x]^(n+2)/((n+1)*(n+2)) -
  Dist[4/((n+1)*(n+2)),Int[x*ArcCos[a*x]^(n+2),x]] /;
FreeQ[a,x] && RationalQ[n] && n<-1 && n!=-2


(* ::Code:: *)
Int[ArcCos[a_.*x_]^n_/x_^3,x_Symbol] :=
  a*n*Sqrt[1-a^2*x^2]*ArcCos[a*x]^(n-1)/(2*x) -
  ArcCos[a*x]^n/(2*x^2) +
  Dist[a^2*n*(n-1)/2,Int[ArcCos[a*x]^(n-2)/x,x]] /;
FreeQ[a,x] && RationalQ[n] && n>1


(* ::Code:: *)
Int[x_^m_*ArcCos[a_.*x_]^n_,x_Symbol] :=
  a*n*x^(m+2)*Sqrt[1-a^2*x^2]*ArcCos[a*x]^(n-1)/((m+1)*(m+2)) +
  x^(m+1)*ArcCos[a*x]^n/(m+1) -
  a^2*(m+3)*x^(m+3)*ArcCos[a*x]^n/((m+1)*(m+2)) +
  Dist[a^2*(m+3)^2/((m+1)*(m+2)),Int[x^(m+2)*ArcCos[a*x]^n,x]] +
  Dist[a^2*n*(n-1)/((m+1)*(m+2)),Int[x^(m+2)*ArcCos[a*x]^(n-2),x]] /;
FreeQ[a,x] && IntegerQ[m] && RationalQ[n] && m<-3 && n>1


(* ::Code:: *)
Int[x_^m_*ArcCos[a_.*x_]^n_,x_Symbol] :=
  -x^m*Sqrt[1-a^2*x^2]*ArcCos[a*x]^(n+1)/(a*(n+1)) -
  m*x^(m-1)*ArcCos[a*x]^(n+2)/(a^2*(n+1)*(n+2)) +
  (m+1)*x^(m+1)*ArcCos[a*x]^(n+2)/((n+1)*(n+2)) -
  Dist[(m+1)^2/((n+1)*(n+2)),Int[x^m*ArcCos[a*x]^(n+2),x]] +
  Dist[m*(m-1)/(a^2*(n+1)*(n+2)),Int[x^(m-2)*ArcCos[a*x]^(n+2),x]] /;
FreeQ[a,x] && IntegerQ[m] && RationalQ[n] && m>1 && n<-1 && n!=-2


(* ::Code:: *)
Int[ArcCos[a_.*x_^p_.]^n_./x_,x_Symbol] :=
  -Dist[1/p,Subst[Int[x^n*Tan[x],x],x,ArcCos[a*x^p]]] /;
FreeQ[{a,p},x] && IntegerQ[n] && n>0


(* ::Code:: *)
Int[x_^m_.*ArcCos[a_.*x_]^n_,x_Symbol] :=
  x^(m+1)*ArcCos[a*x]^n/(m+1) -
  Dist[n/(a^(m+1)*(m+1)),Subst[Int[x^(n-1)*Cos[x]^(m+1),x],x,ArcCos[a*x]]] /;
FreeQ[{a,n},x] && IntegerQ[m] && m!=-1


(* ::Code:: *)
Int[(a_+b_.*ArcCos[c_.+d_.*x_])^n_,x_Symbol] :=
  -Dist[1/d,Subst[Int[(a+b*x)^n*Sin[x],x],x,ArcCos[c+d*x]]] /;
FreeQ[{a,b,c,d},x] && Not[IntegerQ[n]]


(* ::Code:: *)
Int[x_^m_.*(a_+b_.*ArcCos[c_.+d_.*x_])^n_,x_Symbol] :=
  -Dist[1/d^(m+1),Subst[Int[(a+b*x)^n*(Cos[x]-c)^m*Sin[x],x],x,ArcCos[c+d*x]]] /;
FreeQ[{a,b,c,d},x] && IntegerQ[m] && Not[IntegerQ[n]] && m>0


(* ::Code:: *)
Int[x_*ArcCos[a_.+b_.*x_]^n_/Sqrt[u_],x_Symbol] :=
  -Sqrt[u]*ArcCos[a+b*x]^n/b^2 -
  Dist[n/b,Int[ArcCos[a+b*x]^(n-1),x]] -
  Dist[a/b,Int[ArcCos[a+b*x]^n/Sqrt[u],x]] /;
FreeQ[{a,b},x] && ZeroQ[u-1+(a+b*x)^2] && RationalQ[n] && n>1


(* ::Code:: *)
Int[u_.*ArcCos[c_./(a_.+b_.*x_^n_.)]^m_.,x_Symbol] :=
  Int[u*ArcSec[a/c+b*x^n/c]^m,x] /;
FreeQ[{a,b,c,n,m},x]


(* ::Code:: *)
Int[f_^(c_.*ArcCos[a_.+b_.*x_]),x_Symbol] :=
  f^(c*ArcCos[a+b*x])*(a+b*x-c*Sqrt[1-(a+b*x)^2]*Log[f])/(b*(1+c^2*Log[f]^2)) /;
FreeQ[{a,b,c,f},x] && NonzeroQ[1+c^2*Log[f]^2]


(* ::Code:: *)
Int[ArcCos[u_],x_Symbol] :=
  x*ArcCos[u] +
  Int[Regularize[x*D[u,x]/Sqrt[1-u^2],x],x] /;
InverseFunctionFreeQ[u,x] && Not[FunctionOfExponentialOfLinear[u,x]]


(* ::Code:: *)
Int[x_^m_.*ArcCos[u_],x_Symbol] :=
  x^(m+1)*ArcCos[u]/(m+1) +
  Dist[1/(m+1),Int[Regularize[x^(m+1)*D[u,x]/Sqrt[1-u^2],x],x]] /;
FreeQ[m,x] && NonzeroQ[m+1] && InverseFunctionFreeQ[u,x] && 
	Not[FunctionOfQ[x^(m+1),u,x]] && 
	Not[FunctionOfExponentialOfLinear[u,x]]
